package com.east.sng.entity.param;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author east
 * @date: 2020/12/27
 * @Description: teacher information receive param javabean
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TeacherParam {

	@NotNull(message = "{param.id.notnull}")
	private Integer teacherId;
	@NotBlank(message = "{teacher.teachername.notblank}")
	private String teacherName;
	@NotNull(message = "{teacher.teacherage.notnull}")
	@Range(min = 18,max = 55,message = "{teacher.teacherage.range}")
	private Integer teacherAge;
	@NotBlank(message = "{teacher.teachersex.notblank}")
	@Pattern(regexp = "^1|2$",message = "{teacher.teachersex.notblank}")
	private String teacherSex;
	@NotBlank(message = "{teacher.teacherphone.notblank}")
	@Pattern(regexp = "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}$",message = "{teacher.teacherphone.pattern}")
	private String teacherPhone;
	@NotBlank(message = "{teacher.teachertype.notblank}")
	@Pattern(regexp = "^([1-9][0-9]*){1,2}$",message = "{teacher.teachertype.notblank}")
	private String teacherType;
	@NotBlank(message = "{teacher.teacherclassroom.notblank}")
	@Pattern(regexp = "^([1-9][0-9]*){1,2}$",message = "{teacher.teacherclassroom.notblank}")
	private String teacherClassRoom;

}
